<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/angular.js"></script>
</head>
<body>

<div ng-app="app">
    {{"hello"}}

    <div ng-controller="f2">
        表达式 <br>
        <input type="text" ng-model="expr1">
        <button ng-click ="testExpl(expr1)"> jisuan</button>
        <br> <br>
        <input type="text" ng-model="expr2">
        <span ng-bind="$eval(expr2)"></span>

    </div>

    <script type="text/javascript">
        var app = angular.module("app",[]);
        app.controller(f2,function testExpl( $scope) {
            $scope.expr1=20;
            $scope.expr2='20+1 | number:0';
            $scope.testExpl = function (expr) {
                var newv = parseInt(expr) + 1 ;
                console.log(newv);
            }

        })

    </script>
</div>

</body>
</html>